#include "rpgsprite.h"

RpgSprite::RpgSprite(u8 screen, u8 id, void *data, RpgSpritePal *palette)
{
    m_screen = screen;
    m_id = id;
    m_colourMode = 1;
    m_palette = palette;
    m_data = data;

    m_x = 0;
    m_y = 0;
    m_scrollX = 0;
    m_scrollY = 0;
}

void RpgSprite::create()
{
    PA_CreateSprite(m_screen, m_id, m_data, OBJ_SIZE_32X64, m_colourMode, m_palette->id(), norm(m_x), norm(m_y));
}

void RpgSprite::updatePosition()
{
    PA_SetSpriteXY(m_screen, m_id, norm(m_x - m_scrollX), norm(m_y - m_scrollY));
}
